﻿using Rsd.Dudu.ModelProvider;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rsd.Faith.Core
{
    /// <summary>
    /// 
    /// </summary>
    [Table("sys_api_timer", "sys_api_timer", "id")]
    [Serializable]
    public class ApiTimerModel : Rsd.Faith.Core.ModelBase
    {
        /// <summary>
        /// path
        /// </summary>
        [StringType("path", "相对路径", 20, 250)]
        [DisplayName("相对路径")]
        public string Path { get; set; }
        /// <summary>
        /// URL
        /// </summary>
        [StringType("url", "URL", 21, 250)]
        [DisplayName("URL")]
        public string Url { get; set; }

        // <summary>
        /// 分组
        /// </summary>
        [StringType("group", "分组", 22, 50)]
        [DisplayName("分组")]
        public string Group { get; set; }

        /// <summary>
        /// 业务标识
        /// </summary>
        [StringType("method", "请求谓词", 24, 20)]
        [DisplayName("请求谓词")]
        public string Method { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [StringType("text", "描述", 26, 100)]
        [DisplayName("描述")]
        public string Text { get; set; }

        /// <summary>
        /// 请求数据
        /// </summary>
        [StringType("data", "请求数据", 28, 200)]
        [DisplayName("请求数据")]
        public string Data { get; set; }

        /// <summary>
        /// 请求结果
        /// </summary>
        [StringType("resp", "请求结果", 30, 200)]
        [DisplayName("请求结果")]
        public string Respone { get; set; }

        /// <summary>
        /// 执行标识 -1 失败 ，0 ：未执行， 1：成功
        /// </summary>
        [IntegerType("success", "执行标识", 32, 20)]
        [DisplayName("执行标识")]
        public int Success { get; set; }

        /// <summary>
        /// 启用:0:未触发 1:已触发等待执行
        /// </summary>
        [IntegerType("enabled", "启用", 34, 20)]
        [DisplayName("启用")]
        public bool Enabled { get; set; }

        /// <summary>
        /// 执行排序号
        /// </summary>
        [IntegerType("sort_index", "排序", 36, 20)]
        [DisplayName("排序")]
        public long SortIndex { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ApiTimerModel()
        {
            this.Method = "GET";
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="state"></param>
        public ApiTimerModel(Dudu.BizModel.ObjectStateType state)
            :this()
        {
            this.SetState(state);
        }
    }
}
